<div class="ztree-container">

  <div class="ztree-toolbar">
    <form [formGroup]="queryForm" class="form-inline">
      <label class="link no-underline mr-xs-2">
        <span *ngIf="!(isExpanded && sonSign)" (click)="expandOrNot()">全部展开</span>
        <span *ngIf="isExpanded && sonSign" (click)="expandOrNot()">全部收缩</span>
        &nbsp;&nbsp;
        <span *ngIf="settings.usage=='selection' && checkCount" (click)="reset()">取消所有</span>
        <span *ngIf="settings.usage=='selection' && !checkCount" (click)="selectAll()">选择所有</span>
      </label>

      <input [class.hidden]="isDragging" [(ngModel)]="queryModel.keywords" formControlName="keywords"
             type="search" class="form-control form-control-sm" placeholder="过滤" id="keywords" name="keywords">

      <select *ngIf="settings.usage=='selection'" [(ngModel)]="queryModel.projectId" formControlName="projectId"
              class="form-control form-control-sm" id="projectId" name="projectId">
        <option *ngFor="let entry of brotherProjects" value="{{entry.id}}">{{entry.name}}</option>
      </select>

      <span [class.hidden]="!isDragging" [class.highlight]="isToCopy" class="tips">按Ctrl键释放复制</span>
      &nbsp;&nbsp;
      <span *ngIf="checkCount">已选{{checkCount}}个用例</span>
    </form>
  </div>

  <ul id="tree" class="ztree" [style.height]="treeHeight"></ul>
</div>

<ng2-toasty></ng2-toasty>
